package src.com.servlet;

import src.com.service.MyService;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

public class getLastParagraph extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("utf-8");
        resp.setContentType("text/html");
        int pageNnum = Integer.parseInt(req.getParameter("pageNum"));
        MyService myService = new MyService();
        List paraLists = myService.getLastParagraphCoordinate(pageNnum);
        PrintWriter out = resp.getWriter();
        out.print(paraLists.size());
        System.out.println(paraLists.size());
        out.flush();
        out.close();
    }
}
